<div class="modal" ng-controller="DeleteAppDefinitionPopupCtrl">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <h2>{{'APP.POPUP.DELETE-TITLE' | translate}}</h2>
      </div>
      <div class="modal-body">
        <p>{{'APP.POPUP.DELETE-DESCRIPTION-WITH-RUNTIME' | translate:model.app}}</p>

        <div class="form-group" ng-if="model.app.version != 1 && model.app.createdBy == account.id">
          <div class="radio" ng-click="popup.cascade = 'false'">
            <input name="cascadeDelete" ng-model="popup.cascade" type="radio" value="false">
            <strong style="cursor:pointer">{{'APP.POPUP.DELETE-CASCADE-FALSE' | translate:model.app}}</strong>
          </div>
          <div class="radio" ng-click="popup.cascade = 'true'">
            <input name="cascadeDelete" ng-model="popup.cascade" type="radio" value="true">
            <strong style="cursor:pointer">{{'APP.POPUP.DELETE-CASCADE-TRUE' | translate}}</strong>
          </div>
        </div>

      </div>
      <div class="modal-footer">
        <div class="pull-right">
          <button class="btn btn-sm btn-default" ng-click="cancel()" ng-disabled="popup.loading" type="button">
            {{'GENERAL.ACTION.CANCEL' | translate}}
          </button>
          <button class="btn btn-sm btn-danger" ng-click="ok()" ng-disabled="popup.loading || !model.app.name"
                  type="button">
            <span>{{'APP.ACTION.DELETE-CONFIRM' | translate}}</span>
          </button>
        </div>
        <div class="loading pull-right" ng-show="popup.loading">
          <div class="l1"></div>
          <div class="l2"></div>
          <div class="l2"></div>
        </div>
      </div>
    </div>
  </div>
</div>
